<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:decorate template="/resources/template/template_bootstrap.xhtml">

	<ui:define name="title">Finalizar Compra</ui:define>

	<ui:define name="conteudo">
		<p:messages autoUpdate="true" closable="true"></p:messages>


		<p:outputPanel rendered="#{venderMB.renderFormVender}" id="pnlVender">
			<h:form id="vender" prependId="false">


				<p:panel header="Selecione o endereço de entrega e calcule o frete." id="pnlEntrega"
					styleClass="tabela-carrinho margin-top">
					
					<ui:include src="/vender/endereco-detalhes.xhtml">
						<ui:param name="endereco"
							value="#{venderMB.venda.enderecoEntrega}"></ui:param>
					</ui:include>
				</p:panel>




				<p:panel id="pnlPagamento"
					styleClass="tabela-carrinho margin-top"
					header="Selecione a forma de pagamento para concluir a compra.">
					
					<p:panel id="pnlPagamentoPagSeguro" header="Pagamento" styleClass="painel-interno">
					
					
					<div class="row-fluid">
						<div class="span1">
							<h:outputLabel styleClass="font-bold"
								value="#{venderMB.strTotalItens()}" />
						</div>
						<div class="span1">
							<h:outputLabel value="#{venderMB.venda.totalVenda}">
								<f:convertNumber type="currency"></f:convertNumber>
							</h:outputLabel>
						</div>
					</div>

					<div class="row-fluid">
						<div class="span1">
							<h:outputLabel styleClass="font-bold" value="Frete:" />
						</div>
						<div class="span1">
							<h:outputLabel value="#{venderMB.venda.totalFrete}">
								<f:convertNumber type="currency" />
							</h:outputLabel>
						</div>
					</div>

					<div class="row-fluid">
						<div class="span1">
							<h:outputLabel styleClass="font-bold" value="Total geral:" />
						</div>
						<div class="span3">
							<h:outputLabel value="#{venderMB.venda.totalGeral}">
								<f:convertNumber type="currency"></f:convertNumber>
							</h:outputLabel>
						</div>
					</div>
						
						
						
						
						<div class="row-fluid">
							<div class="span1">
								<p:outputLabel styleClass="font-bold" value="PagSeguro"
									for="cmbParcela" />
							</div>

							<div class="span1">
								<p:selectOneMenu value="#{venderMB.numeroParcelas}"
									id="cmbParcela" required="true">
									<f:selectItems value="#{venderMB.opcoesPagamento()}" />
								</p:selectOneMenu>
							</div>
						</div>
					</p:panel>
				</p:panel>


				<p:commandLink value="Concluir compra" ajax="false"
					styleClass="btn-virtual"
					action="#{venderMB.concluirVenda()}" />

			</h:form>
		</p:outputPanel>
	</ui:define>
</ui:decorate>
</html>